/**
 * @param {待判断类型数据源} args
 * @throws {待检测数据的类型字符串} string
 * @exports {待检测数据是否符合预期值} boolean
 */
const getPrototype = args => Object.prototype.toString.call(args).replace(/^\[object\s|\]$/g, '');

export default {
    isString: val => getPrototype(val) === 'String',
    isObject: val => getPrototype(val) === 'Object',
    isArray: val => getPrototype(val) === 'Array',
    isUndefined: val => getPrototype(val) === 'Undefined',
    isNull: val => getPrototype(val) === 'Null',
    isSymbol: val => getPrototype(val) === 'Symbol',
    isFunction: val => getPrototype(val) === 'Function',
    isNumber: val => getPrototype(val) === 'Number',
    isBoolean: val => getPrototype(val) === 'Boolean',
    isDom: val => getPrototype(val) === 'HTMLDivElement'
};
